<template>
  <div>
    <h1>{{ useUserInfoStore.userInfo.userName }}</h1>
  </div>
  <button
    :class="{bg:item.id === useUserInfoStore.userInfo.id }"
    v-for="(item,index) in tapList"
    :key="item.id"
    @click="useUserInfoStore.setUserInfo(item)"
  >
    {{item.userName}}
  </button>

  <hr>
  <comment-one></comment-one>
</template>
<script setup>
import useUserInfo from './stort/index.js'
import {reactive,ref} from "vue";
const tabindex =  ref(-1)
import commentOne from './components/commentOne.vue'
const tapList = reactive([
  {
    id:1,
    userName:'孙志豪'
  },
  {
    id:2,
    userName: '王五',
  },
  {
    id:3,
    userName: '小明',
  }
])
const useUserInfoStore = useUserInfo()




console.log(2423, useUserInfoStore)

</script>
<style scoped>
.bg {
  background-color: skyblue;
}
</style>
